package com.docted.design.pattern.factory.simple;

import com.docted.design.pattern.factory.Mengniu;
import com.docted.design.pattern.factory.Milk;
import com.docted.design.pattern.factory.Yili;

/**
 * @author DoCted
 * @since v1.0 2018/3/5
 */
public class SimpleFactoryTest {

    public static void main(String[] args) {


        SimpleFactory factory = new SimpleFactory();

        Mengniu mengniu = (Mengniu) factory.getMilk("Mengniu");
        System.out.println(mengniu.getName());

        Yili yili = (Yili) factory.getMilk("Yili");
        System.out.println(yili.getName());

        Milk milk = factory.getMilk("Guangming");
        System.out.println(milk.getName());

        Milk milk1 = factory.getMilk("Sanlu");
        System.out.println(milk1.getName());


    }
}
